require "rake/testtask"

task :default => [:test]

Rake::TestTask.new do |t|
  #t.libs << "lib"
#  t.test_files = FileList['test/test_event.rb','test/test_rupeas.rb',
#    'test/test_periodic.rb','test/test_eventset.rb']
  t.test_files = FileList['test/test_*.rb']
  t.verbose = false
end

#Rake::TestTask.new do |t|
#  #t.libs << "lib"
#  t.verbose = false
#end

# add a test:coverage task
namespace :test do

  desc 'Measures test coverage'
  task :coverage do
    rm_f "coverage"
    rm_f "coverage.data"
    rcov = "rcov --aggregate coverage.data --text-summary -Ilib"
    system("#{rcov} --html test/test_*.rb")
#    system("#{rcov} --no-html test/functional/*_test.rb")
#    system("#{rcov} --html test/integration/*_test.rb")
    system("open coverage/index.html") if PLATFORM['darwin']
  end
  
end
